﻿using System.Collections.Generic;
using Resn.WhuPub.BIL;
using Resn.WhuPub.BLL;
using System.Linq;

namespace Resn.WhuPub.WPFClientUI
{
        public class GlobalManager
        {
                #region 构造函数

                private GlobalManager()
                {
                }

                #endregion

                #region 属性

                private static GlobalManager _instance;

                /// <summary>
                /// 获取机车管理器实例
                /// </summary>
                /// <value>
                /// 机车管理器实例
                /// </value>
                public static GlobalManager Instance
                {
                        get { return _instance ?? (_instance = new GlobalManager()); }
                }

                #region 学校

                public List<ICorporate> Corporates { get; set; }


                public ICorporate Corporate { get; set; }

                #endregion


                #region 分校

                public List<ICorporateBranch> CorporateBranchs { get; set; }

                public ICorporateBranch CorporateBranch { get; set; }

                #endregion


                #region 部门

                public IDepartment Department { get; set; }

                #endregion


                #region 联系人

                public List<IContact> Contacts { get; set; }

                public IContact Contact { get; set; }

                #endregion


                #region 反馈

                public IFeedback Feedback { get; set; }

                #endregion

                #region 书籍

                public List<IBook> Books { get; set; }

                public IBook Book { get; set; }

                #endregion

                #region 样书寄送

                public IBookDelivery BookDelivery { get; set; }

                #endregion

                #region 发票经销商

                public IDealer Dealer { get; set; }

                #endregion

                #region 发票寄送

                public IInvoiceDelivery InvoiceDelivery { get; set; }

                #endregion

                #region 专业开设

                public IMajorSetup MajorSetup { get; set; }

                #endregion

                #region 专业运作

                public IMajorOperation MajorOperation { get; set; }

                #endregion

                #region 课程

                public ICourse Course { get; set; }

                #endregion

                #region 课本

                public ICourseBook CourseBook { get; set; }

                #endregion

                #region 差旅

                public ITravel Travel { get; set; }

                #endregion

                #region 差旅拜访

                public ITravelVisit TravelVisit { get; set; }

                #endregion

                #region 门类

                public List<ICategory> Categorys { get; set; }

                public ICategory Category { get; set; }

                public string CategoryName { get; set; }

                public string CategoryCode { get; set; }

                public string CategoryLevel { get; set; }

                #endregion

                #region 科目

                public List<ISubject> Subjects { get; set; }

                public ISubject Subject { get; set; }

                public string SubjectName { get; set; }

                public string SubjectCode { get; set; }

                #endregion


                #region 专业

                public List<IMajor> Majors { get; set; }

                public IMajor Major { get; set; }

                public string MajorName { get; set; }

                public string MajorCode { get; set; }

                #endregion



                #region 用户

                public List<IEmployee> Employees { get; set; }

                public int AdministratorsCount
                {
                        get
                        {
                                return
                                        EmployeeManager.Instance.Employees.Count(i => i.EmployeeLevel == EmployeeLevel.管理员);
                        }
                }

                public int OperatorsCount
                {
                        get
                        {
                                return
                                        EmployeeManager.Instance.Employees.Count(i => i.EmployeeLevel == EmployeeLevel.操作员);
                        }
                }

                public int UsersCount
                {
                        get
                        {
                                return
                                        EmployeeManager.Instance.Employees.Count(i => i.EmployeeLevel == EmployeeLevel.普通用户);
                        }
                }

                public IEmployee Employee { get; set; }

                public string Province { get; set; }

                #endregion


                #endregion
        }
}